//
//  CTStickerView.h
//  ImageView
//
//  Created by 韩威 on 15/5/19.
//  Copyright (c) 2015年 hanwei. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "CTGripViewBorderView.h"

typedef enum{
    CTStickerViewTypePic = 1,
    CTStickerViewTypeBubble
}CTStickerViewType;

@class CTEditeEmojiListDetailsItem;

@protocol CTStickerViewDelegate;
@interface CTStickerView : UIView
{
    CTGripViewBorderView *borderView;
}
@property (nonatomic,strong) CTEditeEmojiListDetailsItem *stickerItem;
@property (assign, nonatomic) UIImageView *contentView;
@property (nonatomic) BOOL preventsPositionOutsideSuperview; //default = YES
@property (nonatomic) BOOL preventsResizing; //default = NO
@property (nonatomic) BOOL preventsDeleting; //default = NO
@property (nonatomic) CGFloat minWidth;
@property (nonatomic) CGFloat minHeight;

@property(nonatomic,copy,setter=setImage:)UIImage *image;
@property(nonatomic,setter=setRect:)CGRect rect;
@property(nonatomic,copy,setter=setStr:)NSString *textStr;
@property(nonatomic,setter=setBubbleTextColor:) UIColor* bubbleTextColor;


@property (strong, nonatomic) id <CTStickerViewDelegate> delegate;

-(instancetype)initWithFrame:(CGRect)frame
                    withType:(CTStickerViewType)type;
-(instancetype)initWithFrame:(CGRect)frame withType:(CTStickerViewType)type withTextViewFrame:(CGRect) textViewFrame;

- (void)hideDelHandle;
- (void)showDelHandle;
- (void)hideEditingHandles;
- (void)showEditingHandles;

@end

@protocol CTStickerViewDelegate <NSObject>
@required
@optional
- (void)stickerViewDidBeginEditing:(CTStickerView *)sticker;
- (void)stickerViewIsEditing:(CTStickerView *)sticker
                   withWidth:(CGFloat)width
                  withHeight:(CGFloat)height
                  withScales:(CGFloat)scale;
- (void)stickerViewDidEndEditing:(CTStickerView *)sticker;
- (void)stickerViewDidCancelEditing:(CTStickerView *)sticker;
- (void)stickerViewDidClose:(CTStickerView *)sticker withItem:(CTEditeEmojiListDetailsItem*)item;
@end
